package org.fms.web.service.vo;

import java.io.Serializable;

/**
 * PACKAGE     : org.fms.web.service.vo
 * CREATE DATE : 2018-03-12
 * AUTHOR      : xiaolu.fan
 * 文件描述     :
 */
public class PageResultVO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 总条数
     **/
    private Long total;
    /**
     * 第几页
     **/
    private Integer pageNumber;
    /**
     * 共几页
     **/
    private Integer pageTotal;
    /**
     * 每页记录条数
     **/
    private Integer pageSize;
    /**
     * 数据数组
     **/
    private Object data;

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public Integer getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(Integer pageNumber) {
        this.pageNumber = pageNumber;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Integer getPageTotal() {
        return pageTotal;
    }

    public void setPageTotal(Integer pageTotal) {
        this.pageTotal = pageTotal;
    }


    public static PageResultVO getPagedResult(Object data, long total, int pageNumber, int pages, int pageSize) {
        PageResultVO pagedResult = new PageResultVO();
        pagedResult.setData(data);
        pagedResult.setTotal(total);
        pagedResult.setPageNumber(pageNumber);
        pagedResult.setPageTotal(pages);
        pagedResult.setPageSize(pageSize);
        return pagedResult;
    }
}